package com.ruoyi.food.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.food.domain.CornTakeOff;
import com.ruoyi.food.mapper.CornTakeOffMapper;
import com.ruoyi.food.service.ICornTakeOffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 玉米脱粒记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-13
 */
@Service
public class CornTakeOffServiceImpl implements ICornTakeOffService
{
    @Autowired
    private CornTakeOffMapper cornTakeOffMapper;

    /**
     * 查询玉米脱粒记录
     * 
     * @param id 玉米脱粒记录主键
     * @return 玉米脱粒记录
     */
    @Override
    public CornTakeOff selectCornTakeOffById(Long id)
    {
        return cornTakeOffMapper.selectCornTakeOffById(id);
    }

    /**
     * 查询玉米脱粒记录列表
     * 
     * @param cornTakeOff 玉米脱粒记录
     * @return 玉米脱粒记录
     */
    @Override
    public List<CornTakeOff> selectCornTakeOffList(CornTakeOff cornTakeOff)
    {
        return cornTakeOffMapper.selectCornTakeOffList(cornTakeOff);
    }

    /**
     * 新增玉米脱粒记录
     * 
     * @param cornTakeOff 玉米脱粒记录
     * @return 结果
     */
    @Override
    public int insertCornTakeOff(CornTakeOff cornTakeOff)
    {
        cornTakeOff.setCreateTime(DateUtils.getNowDate());
        return cornTakeOffMapper.insertCornTakeOff(cornTakeOff);
    }

    /**
     * 修改玉米脱粒记录
     * 
     * @param cornTakeOff 玉米脱粒记录
     * @return 结果
     */
    @Override
    public int updateCornTakeOff(CornTakeOff cornTakeOff)
    {
        cornTakeOff.setUpdateTime(DateUtils.getNowDate());
        return cornTakeOffMapper.updateCornTakeOff(cornTakeOff);
    }

    /**
     * 批量删除玉米脱粒记录
     * 
     * @param ids 需要删除的玉米脱粒记录主键
     * @return 结果
     */
    @Override
    public int deleteCornTakeOffByIds(Long[] ids)
    {
        return cornTakeOffMapper.deleteCornTakeOffByIds(ids);
    }

    /**
     * 删除玉米脱粒记录信息
     * 
     * @param id 玉米脱粒记录主键
     * @return 结果
     */
    @Override
    public int deleteCornTakeOffById(Long id)
    {
        return cornTakeOffMapper.deleteCornTakeOffById(id);
    }
}
